//
// Created by sjjmw on 1/28/2022.
//

#ifndef LEETCODE__15_H
#define LEETCODE__15_H
#include "base.h"
#include "algorithm"

class Solution {
public:
    vector<int> make_ordered_set(int a,int b,int c){
        vector<int> arr(3);
        arr[0]=a;arr[1]=b;arr[2]=c;
        sort(arr.begin(),arr.end());
    }
    vector<vector<int>> threeSum(vector<int>& nums) {
        vector<int> three_set_a;
        std::sort(nums.begin(),nums.end());

        for(int i=0;i<nums.size();i++){
            //第一个数的负数为后两个数之和
            int target=-nums[i];
            int j=0,k=nums.size()-1;

            while(k>j){
                while(nums[j]+nums[k]>=target){
                    k--;
                    if(nums[j]+nums[k]==target){
                        vector<int> set(3);
                        three_set.push_back();
                    }
                }
                while(nums[j]+nums[k]<target){
                    j++;
                }
            }
        }
        return three_set;
    }
};
#endif //LEETCODE__15_H
